package com.foo.web.controller.wechat;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.foo.common.annotation.Log;
import com.foo.common.enums.BusinessType;
import com.foo.wechat.domain.WxOrderPre;
import com.foo.wechat.service.IWxOrderPreService;
import com.foo.common.core.controller.BaseController;
import com.foo.common.core.domain.AjaxResult;
import com.foo.common.utils.poi.ExcelUtil;
import com.foo.common.core.page.TableDataInfo;

/**
 * 预约加工订单Controller
 *
 * @author foo
 * @date 2025-11-20
 */
@Controller
@RequestMapping("/wechat/WxOrderPre")
public class WxOrderPreController extends BaseController
{
    private String prefix = "wechat/WxOrderPre";

    @Autowired
    private IWxOrderPreService wxOrderPreService;

    @RequiresPermissions("wechat:WxOrderPre:view")
    @GetMapping()
    public String WxOrderPre()
    {
        return prefix + "/WxOrderPre";
    }

    /**
     * 查询预约加工订单列表
     */
    @RequiresPermissions("wechat:WxOrderPre:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(WxOrderPre wxOrderPre)
    {
        startPage();
        List<WxOrderPre> list = wxOrderPreService.selectWxOrderPreList(wxOrderPre);
        return getDataTable(list);
    }

    /**
     * 删除预约加工订单
     */
    @RequiresPermissions("wechat:WxOrderPre:remove")
    @Log(title = "预约加工订单", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(wxOrderPreService.deleteWxOrderPreByIds(ids));
    }
}
